define(['app'], function(app) {
    'use strict';

    //实例化方法
    var factory = function (Http) {

        //返回信息
        return {
        	//详情marketing.promotion.detail
        	 detail:function(act_id,callback){
            	Http.post({
            		method:"marketing.promotion.detail",
            		act_id:act_id
            	},function(result){
            		if(callback)
            			callback(result);
            	},function(e){

            	},function(){

            	})
            },       	
            //添加促销
            save:function(
            		act_id,
            		name,
            		description,
            		status,
            		byfixed_value,
            		byfixed_total_amount,
            		topercent_value,
            		topercent_percent,
            		freeshipping_value,
            		solution,
            		sort_order,
            		end_time,
            		start_time,callback){
            	Http.post({            		
            		method:"marketing.promotion.save",
            		act_id:act_id,
            		name:name,
            		description:description,
            		status:status,
            		byfixed_value:byfixed_value,
            		byfixed_total_amount:byfixed_total_amount,
            		topercent_value:topercent_value,
            		topercent_percent:topercent_percent,
            		freeshipping_value:freeshipping_value,
            		solution:solution,
            		sort_order:sort_order,
            		end_time:end_time,
            		start_time:start_time           		
            	},function(result){
            		if(callback)
            			callback(result);
            	},function(e){

            	},function(){

            	})
            }
            
            
        };
    }

    factory.$inject = ['Http'];
    return app.registerService("Addpro", factory);
});